package com.ha8.netease.models.vo
{
	import com.ha8.netease.models.WeiboModel;

	/**
	 * 微博信息的数据模型
	 * 
	 * @author rogo
	 */	
	public class MicroblogModel extends WeiboModel
	{
		public function MicroblogModel(data:Object)
		{
			if (!data)
				return;
			
			user = new UserModel(data.user);
			comments_count = data.comments_count;
			created_at = new Date(data.created_at);
			cursor_id = data.cursor_id;
			favorited = data.favorited;
			flag = data.flag;
			id = data.id;
			text = data.text;
			root_in_reply_to_user_name = data.root_in_reply_to_user_name;
			root_in_reply_to_status_text = data.root_in_reply_to_status_text;
		}
		
		override public function equal(value:WeiboModel):Boolean
		{
			if (value is MicroblogModel && MicroblogModel(value).id == id)
				return true;
			else
				return false;
		}
		
		private var _comments_count:String;
		
		[Bindable]
		
		/**
		 * 评论次数
		 */		
		public function get comments_count():String
		{
			return _comments_count;
		}

		public function set comments_count(value:String):void
		{
			_comments_count = value;
		}
		
		private var _created_at:Date;
		
		[Bindable]
		
		/**
		 * 创建日期
		 */		
		public function get created_at():Date
		{
			return _created_at;
		}

		public function set created_at(value:Date):void
		{
			_created_at = value;
		}
		
		private var _cursor_id:String;
		
		[Bindable]
		
		/**
		 * cursor
		 */		
		public function get cursor_id():String
		{
			return _cursor_id;
		}

		public function set cursor_id(value:String):void
		{
			_cursor_id = value;
		}
		
		private var _favorited:String;
		
		[Bindable]
		
		/**
		 * 是否被收藏
		 */		
		public function get favorited():String
		{
			return _favorited;
		}

		public function set favorited(value:String):void
		{
			_favorited = value;
		}
		
		private var _flag:String;
		
		[Bindable]
		
		/**
		 * 微博类型，normal即原创，retweet即转发，reply即评论，deleted即删除
		 */		
		public function get flag():String
		{
			return _flag;
		}

		public function set flag(value:String):void
		{
			_flag = value;
		}
		
		private var _id:String;
		
		[Bindable]
		
		public function get id():String
		{
			return _id;
		}

		public function set id(value:String):void
		{
			_id = value;
		}
		
		private var _text:String;
		
		[Bindable]
		
		public function get text():String
		{
			return _text;
		}

		public function set text(value:String):void
		{
			_text = value;
		}
		
		private var _root_in_reply_to_user_name:String;
		
		[Bindable]
		
		public function get root_in_reply_to_user_name():String
		{
			return _root_in_reply_to_user_name;
		}

		public function set root_in_reply_to_user_name(value:String):void
		{
			_root_in_reply_to_user_name = value;
		}
		
		private var _root_in_reply_to_status_text:String;
		
		[Bindable]
		
		public function get root_in_reply_to_status_text():String
		{
			return _root_in_reply_to_status_text;
		}

		public function set root_in_reply_to_status_text(value:String):void
		{
			_root_in_reply_to_status_text = value;
		}
		
		private var _user:UserModel;
		
		[Bindable]
		
		/**
		 * 微博所属用户
		 */	
		public function get user():UserModel
		{
			return _user;
		}

		public function set user(value:UserModel):void
		{
			_user = value;
		}
		
	}
}